/* -*-  Mode:C; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
/*
 * Copyright (c) 1999, 2000 Massachusetts Institute of Technology.
 *
 * This software is being provided by the copyright holders under the GNU
 * General Public License, either version 2 or, at your discretion, any later
 * version. (See the file `LICENSE' in the Linux source distribution.)
 *
 * This software is provided "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The entire risk as
 * to the quality and performance of the program is with you. See the GNU
 * General Public License for more details.
 *
 * The name and trademarks of copyright holders may NOT be used in 
 * advertising or publicity pertaining to the software without specific, 
 * written prior permission. Title to copyright in this software and any 
 * associated documentation will at all times remain with copyright 
 * holders. See the file CMAUTHORS which should have accompanied this software 
 * for a list of all copyright holders. 
 * 
 * Particular files in this distribution may be derived from previously
 * copyrighted software. This copyright applies only to those changes made by
 * the copyright holders listed in the CMAUTHORS file.
 */
/*
 * An implementation of the Congestion Manager (CM) for Linux.
 * Debugging levels for the CM.
 */

#define CM_DEBUG_NONE           0x0000
#define CM_DEBUG_INIT           0x0001
#define CM_DEBUG_FUNCALL        0x0002
#define CM_DEBUG_MACROFLOW_INIT 0x0004
#define CM_DEBUG_FLOW_INIT      0x0008
#define CM_DEBUG_SCHED          0x0010
#define CM_DEBUG_SOCKET		0x0020
#define CM_DEBUG_ERRS		0x0040
#define CM_DEBUG_CONGCTL	0x0080
#define CM_DEBUG_CONGCTL_VERBOSE	0x0100
#define CM_DEBUG_USER_ERRS      0x0200

#define CM_DEBUG_ALL            0xFFFF

#define CM_DEBUG (CM_DEBUG_INIT | CM_DEBUG_ERRS | CM_DEBUG_USER_ERRS | CM_DEBUG_CONGCTL | CM_DEBUG_CONGCTL_VERBOSE)
/*#define CM_DEBUG (CM_DEBUG_INIT | CM_DEBUG_ERRS | CM_DEBUG_USER_ERRS)*/


#if CM_DEBUG
#define CM_DPRINTF(sec, fmt, args...) \
        do {                          \
        if ((sec)&CM_DEBUG)           \
          printk(fmt, ##args);        \
        } while (0);

#define CM_DEBUG_ENTER()  \
        CM_DPRINTF(CM_DEBUG_FUNCALL, "cm_debug: entering %s\n", __FUNCTION__);

#define CM_DEBUG_EN(EXTRA)                                   \
        CM_DPRINTF(CM_DEBUG_FUNCALL|EXTRA,                   \
		   "cm_debug: entering %s\n", __FUNCTION__);

#else
#define CM_DPRINTF(args...)
#define CM_DEBUG_ENTER()
#define CM_DEBUG_EN(args...)
#endif
